#pragma once

#pragma warning(push)
#pragma warning(disable:4251)

#include "UIImgInterface.h"

#include <GdiPlus.h>
using namespace Gdiplus;
#pragma comment(lib,"gdiplus.lib")

class CUIImgGdiplus /*: public CUIImgInterface*/
{
public:
    CUIImgGdiplus( void );
    virtual ~CUIImgGdiplus( void );

    virtual void Draw( HDC hDC );
    BOOL LoadImg( LPCTSTR lpszImg );
    BOOL LoadImg( UINT uID, IMGDIRECTION imgDir, UINT iImgCount = 1 );
    BOOL LoadImg( LPCTSTR lpszImg, IMGDIRECTION imgDir, UINT iImgCount = 1 );
    void SetPosition( int iLeft, int iTop );
    void SetSize( int iWidth, int iHeight );
    void SetMargin( const RECT& rcMargin );

    const POINT GetPosition()const;
    const SIZE GetSize()const;
    void GetBorder( RECT& rcBorder );
    void SetCurStatus( int iStatus );
protected:
    Image* GetImage( LPCTSTR lpszImg );
    int GetCurStatus()const;
private:
    void Destroy();

protected:
    Image* m_pImage;
    TCHAR m_strImg[MAX_PATH];
    BOOL m_bLoad;

    int m_iLeft;
    int m_iTop;
    int m_iWidth;
    int m_iHeight;

    int m_iImgLeft;
    int m_iImgTop;
    int m_iImgWidth;
    int m_iImgHeight;

    IStream*   pstm;
    HGLOBAL   m_hMem;
    BYTE*   lpRsrc;
    UINT m_iSubImgCount;
    IMGDIRECTION m_imgDirection;
    UINT m_iCurStatus;
};

#pragma warning(pop)

